package game.assist.diablo3.data.dao.impl;

import game.assist.diablo3.data.dao.DataCategoryDAO;
import game.assist.diablo3.data.vo.DataCategory;
import game.assist.diablo3.db.DiabloDatabaseHelper;

import java.sql.SQLException;
import java.util.ArrayList;

import com.j256.ormlite.android.apptools.OrmLiteBaseActivity;
import com.j256.ormlite.dao.Dao;

public class DataCategoryDAOImpl implements DataCategoryDAO {

	private OrmLiteBaseActivity<DiabloDatabaseHelper> ormLiteBaseActivity;

	public DataCategoryDAOImpl(OrmLiteBaseActivity<DiabloDatabaseHelper> ormLiteBaseActivity) {
		super();
		this.ormLiteBaseActivity = ormLiteBaseActivity;
	}

	@Override
	public ArrayList<DataCategory> queryAllDataCategory() throws SQLException {
		Dao<DataCategory, Integer> dataCategoryDao = ormLiteBaseActivity.getHelper().getDatasDao();
		ArrayList<DataCategory> dataCategoryList = (ArrayList<DataCategory>) dataCategoryDao.queryForAll();
		return dataCategoryList;
	}

}
